

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	'enableAjaxValidation'=>false,
)); ?>


	<div class="line">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>128, 'class'=>'medium')); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'dateRegistered'); ?>
		<?php echo $form->textField($model,'dateRegistered', array('class'=>'datepicker', 'value'=>$this->formateDate($model->dateRegistered))); ?>
		<?php echo $form->error($model,'dateRegistered'); ?>
	</div>


	<div class="line">
		<?php echo $form->labelEx($model,'nickname'); ?>
		<?php echo $form->textField($model,'nickname',array('size'=>50,'maxlength'=>50, 'class'=>'medium')); ?>
		<?php echo $form->error($model,'nickname'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'profile_surname'); ?>
		<?php echo $form->textField($model,'profile_surname',array('size'=>50,'maxlength'=>50, 'class'=>'medium')); ?>
		<?php echo $form->error($model,'profile_surname'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'profile_name'); ?>
		<?php echo $form->textField($model,'profile_name',array('size'=>50,'maxlength'=>50, 'class'=>'medium')); ?>
		<?php echo $form->error($model,'profile_name'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'profile_middlename'); ?>
		<?php echo $form->textField($model,'profile_middlename',array('size'=>50,'maxlength'=>50, 'class'=>'medium')); ?>
		<?php echo $form->error($model,'profile_middlename'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'birthday'); ?>
		<?php echo $form->textField($model,'birthday', array('class'=>'medium', 'value'=>$this->formateDate($model->birthday, false))); ?>
		<?php echo $form->error($model,'birthday'); ?>
	</div>

	<div class="line" style="display:none">
		<?php echo $form->labelEx($model,'city_id'); ?>
		<?php echo $form->textField($model,'city_id', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'city_id'); ?>
	</div>

	<div class="line" style="display:none">
		<?php echo $form->labelEx($model,'country_id'); ?>
		<?php echo $form->textField($model,'country_id', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'country_id'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'profile_phone'); ?>
		<?php echo $form->textField($model,'profile_phone',array('size'=>20,'maxlength'=>20, 'class'=>'medium')); ?>
		<?php echo $form->error($model,'profile_phone'); ?>
	</div>

	

	<div class="line">
		<?php echo $form->labelEx($model,'profile_site'); ?>
		<?php echo $form->textField($model,'profile_site',array('size'=>30,'maxlength'=>30, 'class'=>'medium')); ?>
		<?php echo $form->error($model,'profile_site'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'profile_icq'); ?>
		<?php echo $form->textField($model,'profile_icq',array('size'=>8,'maxlength'=>8, 'class'=>'medium')); ?>
		<?php echo $form->error($model,'profile_icq'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'profile_skype'); ?>
		<?php echo $form->textField($model,'profile_skype',array('size'=>5,'maxlength'=>5, 'class'=>'medium')); ?>
		<?php echo $form->error($model,'profile_skype'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'profile_aboutme'); ?>
		<?php echo $form->textArea($model,'profile_aboutme', array('class'=>'medium')); ?>
		<?php echo $form->error($model,'profile_aboutme'); ?>
	</div>

	<div class="line">
		<?php echo $form->labelEx($model,'profile_interests'); ?>
		<?php echo $form->textArea($model,'profile_interests',array('size'=>8,'maxlength'=>8, 'class'=>'medium')); ?>
		<?php echo $form->error($model,'profile_interests'); ?>
	</div>

	
	
	<p class="note">Поля помеченные <span class="required">*</span> обязательны для заполнения.</p>
	
	<div class="line button">
		<button type="submit" class="green big"><span><?= $model->isNewRecord ? 'Добавить' : 'Сохранить'; ?></span></button>
		<button type="button" onclick="window.location.href=' <?=$this->createUrl('admin'); ?>'" class="green big"><span>Отмена</span></button>
	</div>

<?php $this->endWidget(); ?>
<div style="height:20px;"></div>
<? if (!$model->isNewRecord): ?>
<h1 style="margin-left:15px;">Установить пароль</h1>
<?php $formP=$this->beginWidget('CActiveForm', array(
	'id'=>'lostpass',
	'enableAjaxValidation'=>true,
)); ?>

	
<?php echo $form->hiddenField($model,'email'); ?>
		
		
	<div class="line">
		<?php echo $formP->labelEx($model,'password'); ?>
		<?php echo $formP->passwordField($model,'password', array('class'=>'medium', 'value'=>'')); ?>
		<?php echo $formP->error($model,'password'); ?>
	</div>
	
	

	<div class="line">
		<?php echo $formP->labelEx($model,'passwordRepeat'); ?>
		<?php echo $formP->passwordField($model,'passwordRepeat', array('class'=>'medium')); ?>
		<?php echo $formP->error($model,'passwordRepeat'); ?>
	</div>
	<div class="line">
		<?php echo CHtml::label('Отправить пользователю письмо','sendmail'); ?>
		<?php echo CHtml::checkBox('sendmail', '0'); ?>
		
	</div>
	
	<div id="queryresult" style="color:red;"></div>
	<div style="clear: both;"></div>
	<div class="line button">
				<button type="button" id="setpassword"  class="red big"><span>Установить</span></button>
	</div>
<?php $this->endWidget(); ?>
<? endif; ?>
<script>
	/*<![CDATA[*/
	jQuery(function($) {
		jQuery('body').undelegate('#setpassword','click').delegate('#setpassword','click',function(){
			jQuery.ajax({
				'url':'<?= Yii::app()->createUrl('/user/admin/setpassword'); ?>',
				'type':'POST',
				'cache':false,
				'data':jQuery(this).parents("form").serialize(),
				'success':function(html){jQuery("#queryresult").html(html)}
			});
			return false;
			});
	});/*]]>*/
	
	
</script>



